//import java.lang.System.Logger;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

public class CashCard 
{
  Logger logger = Logger.getLogger(CashCard.class.getName());//.getLogger(CashCard.class);

  /**
   * 提现
   *
   * @param orderId 单号
   * @param amount  金额
   * @return 状态码 0000成功、0001失败、0002重复
   */
  public String withdrawal(String orderId, BigDecimal amount) 
  {
    logger.info("提现成功，单号：" + orderId + " 金额：" + amount);
    return "0000";
  }

  /**
   * 储蓄
   *
   * @param orderId 单号
   * @param amount  金额
   */
  public String recharge(String orderId, BigDecimal amount) 
  {
    // 模拟充值成功
    logger.info("储蓄成功，单号：" + orderId + "金额：" + amount);
    return "0000";
  }

  /**
   * 交易流水查询
   * @return 交易流水
   */
  public List<String> tradeFlow() 
  {
    logger.info("交易流水查询成功");
    List<String> tradeList = new ArrayList<String>();
    {
      tradeList.add("100001,100.00");
      tradeList.add("100001,80.00");
      tradeList.add("100001,76.50");
      tradeList.add("100001,126.00");
    }
    return tradeList;
  }
}
